package com.inossem.greendao.dao_package;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.inossem.greendao.Mat;
import com.inossem.greendao.WhCode;

import com.inossem.greendao.dao_package.MatDao;
import com.inossem.greendao.dao_package.WhCodeDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig matDaoConfig;
    private final DaoConfig whCodeDaoConfig;

    private final MatDao matDao;
    private final WhCodeDao whCodeDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        matDaoConfig = daoConfigMap.get(MatDao.class).clone();
        matDaoConfig.initIdentityScope(type);

        whCodeDaoConfig = daoConfigMap.get(WhCodeDao.class).clone();
        whCodeDaoConfig.initIdentityScope(type);

        matDao = new MatDao(matDaoConfig, this);
        whCodeDao = new WhCodeDao(whCodeDaoConfig, this);

        registerDao(Mat.class, matDao);
        registerDao(WhCode.class, whCodeDao);
    }
    
    public void clear() {
        matDaoConfig.clearIdentityScope();
        whCodeDaoConfig.clearIdentityScope();
    }

    public MatDao getMatDao() {
        return matDao;
    }

    public WhCodeDao getWhCodeDao() {
        return whCodeDao;
    }

}
